<div class="layui-form-item">
    <label for="" class="layui-form-label">{{ $lable??'选择图标' }}</label>
    <div class="layui-input-block">
        <input type="text" name="{{ $name??'icon' }}" id="iconPicker2" value="{{ $val??'' }}" lay-filter="iconPicker2" class="layui-input">
    </div>
</div>

@section('js')
    @parent
    <script>
        layui.extend({
            'iconPicker':'/asset/lib/extend/iconPicker'
        }).use(['iconPicker', 'form','layer','jquery'], function () {
            var $ = layui.$,
                iconPicker = layui.iconPicker,
                form = layui.form;

            iconPicker.render({
                // 选择器，推荐使用input
                elem: '#iconPicker2',
                // 数据类型：fontClass/unicode，推荐使用fontClass
                type: 'fontClass',
                // 是否开启搜索：true/false
                search: false,
                // 是否开启分页
                page: true,
                // 每页显示数量，默认12
                limit: 12,
                // 点击回调
                click: function (data) {
                },
                // 渲染成功后的回调
                success: function(d) {
                }
            });
            var icon = $('input[name={{$name??'icon'}}]').val();
            iconPicker.checkIcon('iconPicker2', icon);
        });
    </script>
@endsection